#!/usr/bin/env python
# coding=utf8


import sys

import os
def control(path):
    listfile=os.listdir(path)

    for i in listfile:
        if i.find('.COMPLETED')>0:
            oldname = os.path.abspath(i)
            newname = oldname[:-10]
            print oldname
            print newname
            os.rename(oldname,newname)

if __name__ == "__main__":
    path='../logs'
    control(path)
